package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DishFlavorMaper {

    //保存批量导入口味
    void batchSave(@Param("flavors") List<DishFlavor> flavors);

    //根据菜品id查询数据
    @Select("select * from dish_flavor where dish_id=#{dishId}")
    List<DishFlavor> findByDishId(Long dishId);

    //
    @Delete("delete from dish_flavor where dish_id=#{dishId}")
    void deleteByDishId(Long id);


    void deleteByFlavorIds(List<Long> ids);
}
